from numpy import *
SIZE = 64
SEED = 1
def generarOrtogonales(veces):
    a = 1
    res = []
    for x in range(veces):
        b = ([1] * (a/2)) + ([-1] *(a/2))
        if len(b) == 0:
            b = [1]
        veces = SIZE/len(b)
        if veces > 0:
         	b = b*veces
        b = [str(d) for d in b]
        m = '[' + ' '.join(b) + ']'
        res.append(matrix(m).T)
        a *= 2
    return res

def generarSemiOrtogonal(veces):
    a = 1
    res = []
    for x in range(veces):
        b = [1]*x + [-1]*(SIZE - x)
        b = [str(d) for d in b]
        m = '[' + ' '.join(b) + ']'
        res.append(matrix(m).T)
        a += 1
    return res

def generarAleatorios(veces):
    res = []
    for x in range(veces):
        res.append(sign(matrix(random.rand(SIZE)).T - 0.5))
    return res

def generarSimilares(p,cantidad,max_flips):
    res = []
    for x in range(cantidad):
       new = p.copy()
       for f in range(max_flips):
           i = random.randint(SIZE-1)
           new[i,0] *= -1
       res.append(new)
    return res

